package com.example.grpc.openapi.client.spring;

import com.example.grpc.openapi.CreateOpenAPI;
import com.example.grpc.openapi.client.create.CreateOpenAPIGrpcClient;
import org.springframework.context.annotation.Bean;

public class SpringClientEnableAutoConfiguration {

    /**
     * 默认超时时间（毫秒）
     */
    public static final long DEFAULT_MILLIS_TIMEOUT = 1000L;

    private String target = "localhost:8081";

    @Bean
    public CreateOpenAPI createOpenApi() {
        return createOpenApiNew();
    }

    private CreateOpenAPI createOpenApiNew() {
        return CreateOpenAPIGrpcClient.getInstance(target, DEFAULT_MILLIS_TIMEOUT);
    }


}
